<!DOCTYPE html>
<html>
<head>
    <title>{{ post.title }}</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.1.0/github-markdown.min.css">
    <style>
        .markdown-body { max-width: 800px; margin: 0 auto; padding: 20px; }
        .post-meta { color: #666; margin-bottom: 30px; }
        .tags { margin-top: 20px; }
        .tag { background: #eee; padding: 3px 8px; border-radius: 3px; }
    </style>
</head>
<body>
    <div class="container">
        <article class="markdown-body">
            <h1>{{ post.title }}</h1>

            <div class="post-meta">
                <time>{{ post.created_at.strftime('%Y-%m-%d') }}</time> •
                作者：{{ post.author }} •
                阅读：{{ post.views }}
            </div>

            <!-- 渲染安全HTML -->
            <div class="content">
                {{ post.html_content|safe }}
            </div>

            <div class="tags">
                {% for tag in post.tags %}
                <span class="tag">#{{ tag }}</span>
                {% endfor %}
            </div>
        </article>
    </div>
</body>
</html>